package com.liveneo.system.base.utils;

import com.liveneo.adapter.mobile.support.MobileReturnCodeSupport;

/**
 * 异常处理类
 * @author wangxx
 *
 * @since 2016年6月17日
 */
public class AppException extends Exception {

	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = -95688886891113608L;
	
	private String code;
	
	private String detailCode;
	
	
	/** 
	 * 构造函数 调用MobileReturnCodeSupport中的错误代码及错误详细码，会自动调用其错误信息
	 * 
	 * @param code 错误代码
	 * @param detailCode 错误详细码
	 */
	public AppException(String code, String detailCode) {
		super(MobileReturnCodeSupport.getDetailMessage(code, detailCode));
		this.code = code;
		this.detailCode = detailCode;
	}
	
	/**
	 * 构造函数 调用MobileReturnCodeSupport中的错误代码及错误详细码，会自动调用其错误信息
	 * @param code 错误代码
	 * @param detailCode 错误详细码
	 * @param cause 异常信息
	 */
	public AppException(String code, String detailCode, Throwable cause) {
		super(MobileReturnCodeSupport.getDetailMessage(code, detailCode), cause);
		this.code = code;
		this.detailCode = detailCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDetailCode() {
		return detailCode;
	}

	public void setDetailCode(String detailCode) {
		this.detailCode = detailCode;
	}
	
	


}
